package com.hjl.spring6.resource.controller;

import com.hjl.spring6.resource.service.UserService;
import com.hjl.spring6.resource.service.UserServiceImpl;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Controller;

/**
 * @author ServivE
 * @version 0.1
 * @className UserController
 * @description
 * @date 2024/8/6 19:26
 * @since jdk11
 */
@Controller(value = "myUserContoller")
public class UserController {

/*    //根据名称进行注入
    @Resource(name = "myUserService")
    private UserService userService;*/
    //不指定名称属性名和bean对象名也不一样  根据类型注入
    @Resource
    private UserService userService;
    public void add() {
        System.out.println("controller....");
        userService.addUserService();
    }

}
